﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="editclienttype.aspx.cs" Inherits="editclienttype" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript"> 
        function KeyDownHandler() { 
            // process only the Enter key 
            if (event.keyCode == 13) {
                __doPostBack('<%=gvEditClientType.FooterRow.FindControl("btClientTypeInsert").UniqueID%>', ''); 
            } 
        } 
    </script>     
</head>
<body>
    <form id="form1" runat="server">
        <prt:ShowFooterGridView ID="gvEditClientType" runat="server" DataSourceID="dsClientType" AutoGenerateColumns="false" 
            DataKeyNames="ClientTypeID" ShowHeader="true" ShowFooter="true"  ShowFooterWhenEmpty="true" ShowHeaderWhenEmpty="true">
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:LinkButton ID="btClientTypeInsert" runat="server" Text="Add" OnClick="btClientType_Click" />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Description" SortExpression="Description">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Description") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Description") %>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="tbDescription_Insert" runat="server" />
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
        </prt:ShowFooterGridView>
        
        <asp:ObjectDataSource ID="dsClientType" runat="server" 
            DeleteMethod="Delete" InsertMethod="Insert" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
            TypeName="AnseringServiceTableAdapters.ClientTypeTableAdapter" 
            UpdateMethod="Update">
            <DeleteParameters>
                <asp:Parameter Name="Original_ClientTypeID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Original_ClientTypeID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Description" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        
    </form>
</body>
</html>
